import React from 'react';
import App from './App';
import { BrowserRouter, Route, Link, Switch } from 'react-router-dom';


function TwoYing() {
  return <h2>二营</h2>
}

function ThreeYing() {
  return <h2>三营</h2>
}

// class Test extends React.Component {
//   constructor(props) {
//     super(props);
//   }
//   render() {
//     console.log(this.props);
//     return <h2>Test组件 {this.props.match.params.location}</h2>;
//   };
// }


class Dashboard extends React.Component {
  // constructor( props){
  //   super(props);
  // }
  render() {
    return <div>
      <ul>
          <li>
            <Link to='/dashboard/'>一营</Link>
          </li>
          <li>
            <Link to='/dashboard/two'>二营</Link>
          </li>
          <li>
            <Link to='/dashboard/three'>三营</Link>
          </li>
      </ul>
      <BrowserRouter>
        <Switch>
          <Route path='/dashboard/' component={App}/>
          <Route path='/dashboard/two' component={TwoYing}/>
          <Route path='/dashboard/three' component={ThreeYing}/>
        </Switch>
    </BrowserRouter>
    </div>
  }
}

export default Dashboard;